<?php defined('IN_ADMIN') or exit('No permission resources.'); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"<?php if(isset($addbg)) { ?> class="addbg"<?php } ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8 echo CHARSET?>" />
<meta http-equiv="X-UA-Compatible" content="IE=7" />
<title><?php echo L('website_manage');?></title>
<link href="<?php echo CSS_PATH?>reset.css" rel="stylesheet" type="text/css" />
<link href="<?php echo CSS_PATH?>system.css" rel="stylesheet" type="text/css" />
<link href="<?php echo CSS_PATH?>table_form.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="<?php echo JS_PATH?>jquery.min.js"></script>
<script language="javascript" type="text/javascript" src="<?php echo JS_PATH?>admin_common.js"></script>
</head>
<body>
<table width="100%" class="table_form" id="sendbox">
	<?php if(is_array($result)) foreach($result as $r) {?>
  	<tr>
	    <td class="align_r">
		<input type="input" value="<?php echo $r[title]?>" size="45" name="title[<?php echo $r[id]?>]">
		<?php if($r[thumb]) {?><img src="http://open.phpcms.cn/statics/images/icon/small_img.gif" /><input value="<?php echo $r[thumb]?>" size="50" name="thumb[<?php echo $r[id]?>]" type="hidden" ><?php } ?>
		<input type="hidden" value="<?php echo $r[url]?>" size="50" name="url[<?php echo $r[id]?>]"><span></span>
		</td> 
  	</tr>
    <?php } ?>
</table>
<script type="text/javascript">
function sendtoweibo() {
	$("#sendbox tr").each(function(i){
		 var s = $(this).children('td');
		 var title = s.children('input[name^="title"]').val();			
		 var url = s.children('input[name^="url"]').val();			
		 var thumb = s.children('input[name^="thumb"]').val();	
		 var posturl = '?m=admin&c=plugin&a=config&pluginid=<?php echo $pluginid?>&module=pushtoweibo&pc_hash=<?php echo $_SESSION['pc_hash']?>';			 var tips = s.children('span');
		 tips.html('<img src="<?php echo PLUGIN_STATICS_PATH;?>weibo/loading.gif" /> <?php echo pluginlang('pleasewait','','weibo')?>');
		 $.post(posturl,{ sendsubmit: "1", title:title, url:url, thumb:thumb},function(e){ 
			 if (e ==1 ) tips.html('<img src="<?php echo PLUGIN_STATICS_PATH;?>weibo/ok.png" /> <?php echo pluginlang('successsend','','weibo')?>');
			 else tips.html('<img src="<? echo PLUGIN_STATICS_PATH;?>weibo/fail.png" /> <font color="red"><?php echo pluginlang('faiedssend','','weibo')?></font>');
		 })
	});
}
</script>